home *** CD-ROM | disk | FTP | other *** search
/ Magnum One / Magnum One (Mid-American Digital) (Disc Manufacturing).iso / d6 / glazer.arc / PERDEPOS.BAS < prev    next >
BASIC Source File  |  1988-10-07  |  1KB  |  29 lines

  1. 100 'Periodic Deposit ("PERDEPOSIT")
  2. 110 CLS
  3. 120 COLOR 0,15 : PRINT "Periodic Deposit" : COLOR 15,0
  4. 130 DEFDBL A-Z
  5. 140 DEFINT M-N
  6. 150 MONEYFMT$ = "$$##,###,###.##"
  7. 160 '     Let user enter data
  8. 170 PRINT: PRINT "Do not enter dollar signs or commas"
  9. 180 PRINT
  10. 190 INPUT "Savings goal: ", FV
  11. 200 INPUT "Annual interest rate (in percent): ", AR
  12. 210 INPUT  "Number of years: ", NYEARS
  13. 220 INPUT "Number of deposits per year: ", NPY
  14. 230 INPUT "Annual inflation rate (in percent): ", INFLATION
  15. 240 INPUT  "Marginal tax rate (in percent): ",TAXRATE
  16. 250 '     Determine after-tax, periodic interest rate
  17. 260 PR = (1 + AR / 100) ^ (1 / NPY) - 1
  18. 270 PR = PR * (1 - TAXRATE / 100)
  19. 280 '     Find periodic deposit
  20. 290 IF PR <> 0  THEN DEPOSIT = FV / ( (1+PR) * ( (1+PR) ^ (NPY*NYEARS) -1) / PR)                ELSE DEPOSIT=FV/(NPY*NYEARS)
  21. 300 ADJUSTEDEPOSIT = DEPOSIT * (1 + INFLATION / 100) ^ NYEARS
  22. 310 '     Print results
  23. 320 PRINT
  24. 330 PRINT "Periodic deposit to reach nominal goal:"; TAB(51);
  25. 340 PRINT USING MONEYFMT$; DEPOSIT
  26. 350 PRINT "Periodic deposit to reach inflation-adjusted goal:"; TAB(51);
  27. 360 PRINT USING MONEYFMT$; ADJUSTEDEPOSIT
  28. 370 END
  29.